// kX Driver / kX Driver Interface / kX Driver Effects Library
// Copyright (c) Eugene Gavrilov and Max Mikhailov, 2002-2004.
// All rights reserved

/*
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */

// 10kX microcode


const char* surrounder2_name		= "Surrounder+";
const char* surrounder2_copyright	= "(c) Max Mikhailov and Eugene Gavrilov, 2002-2008";
const char* surrounder2_engine	= "kX";
const char* surrounder2_created	= "Feb 20 2003 / Oct 2003 / May 2004 / Jul 2008";
const char* surrounder2_comment	= "surround sound and channel separation plugin - v2.0 beta; $nobypass";
const char* surrounder2_guid		= "0c37979a-ac18-4898-900d-5c6d33557421";

int surrounder2_itramsize	= 0x00784; // 40.08 msec (1924 samples)
int surrounder2_xtramsize	= 0x00000; // 0 msec (0 samples)

#define R(i)
#define _	0xFFFF,
dsp_register_info surrounder2_info[] =
{
R(0)	{"in_L", 		0x4000u, 0x07, _ 0x00000000},	// input
R(1)	{"in_R", 		0x4001u, 0x07, _ 0x00000000},	// input
R(2)	{"in_nw", 		0x4002u, 0x07, _ 0x00000000},	// input
R(3)	{"in_ne", 		0x4003u, 0x07, _ 0x00000000},	// input
R(4)	{"in_sw", 		0x4004u, 0x07, _ 0x00000000},	// input
R(5)	{"in_se", 		0x4005u, 0x07, _ 0x00000000},	// input
R(6)	{"in_n", 		0x4006u, 0x07, _ 0x00000000},	// input
R(7)	{"in_lfe", 		0x4007u, 0x07, _ 0x00000000},	// input
R(8)	{"in_w", 		0x4008u, 0x07, _ 0x00000000},	// input
R(9)	{"in_e", 		0x4009u, 0x07, _ 0x00000000},	// input
R(10)	{"in_s", 		0x400Au, 0x07, _ 0x00000000},	// input
R(11)	{"in_top", 		0x400Bu, 0x07, _ 0x00000000},	// input
R(12)	{"fL", 			0x8000u, 0x08, _ 0x00000000},	// output
R(13)	{"fR", 			0x8001u, 0x08, _ 0x00000000},	// output
R(14)	{"sL", 			0x8002u, 0x08, _ 0x00000000},	// output
R(15)	{"sR", 			0x8003u, 0x08, _ 0x00000000},	// output
R(16)	{"Center", 		0x8004u, 0x08, _ 0x00000000},	// output
R(17)	{"LFE", 		0x8005u, 0x08, _ 0x00000000},	// output
R(20)	{"CK", 			0x8008u, 0x01, _ 0x00000000},	// static
R(21)	{"SK1", 		0x8009u, 0x01, _ 0x00000000},	// static
R(22)	{"SK2", 		0x800Au, 0x01, _ 0x00000000},	// static
R(23)	{"lb", 			0x800Bu, 0x01, _ 0x00000000},	// static
R(24)	{"rb", 			0x800Cu, 0x01, _ 0x00000000},	// static
R(25)	{"wfa", 		0x800Du, 0x01, _ 0x00160CA6},	// static
R(26)	{"wfy", 		0x800Eu, 0x01, _ 0x7B42EE7B},	// static, 0.963
R(27)	{"wfb", 		0x800Fu, 0x01, _ 0x84A704DE},	// static
R(28)	{"wfzl", 		0x8010u, 0x01, _ 0x00000000},	// static
R(29)	{"wfzr", 		0x8011u, 0x01, _ 0x00000000},	// static
R(30)	{"vWl", 		0x8012u, 0x01, _ 0x00000000},	// static
R(31)	{"vWr", 		0x8013u, 0x01, _ 0x00000000},	// static
R(32)	{"dwL", 		0x8014u, 0x49, _ 0x00000000},
R(33)	{"&dwL", 		0x8015u, 0x0B, _ 0x00000000},
R(34)	{"dwR", 		0x8016u, 0x49, _ 0x000003C2},
R(35)	{"&dwR", 		0x8017u, 0x0B, _ 0x000003C2},
R(36)	{"drL", 		0x8018u, 0x29, _ 0x00000002},
R(37)	{"&drL", 		0x8019u, 0x0B, _ 0x00000002},
R(38)	{"drR", 		0x801Au, 0x29, _ 0x000003C4},
R(39)	{"&drR", 		0x801Bu, 0x0B, _ 0x000003C4},

// should be last
R(18)	{"sCenter1", 	0x8006u, 0x08, _ 0x00000000},	// output
R(19)	{"sCenter2", 	0x8007u, 0x08, _ 0x00000000},	// output

};
#undef _
#undef R

#define I(i)

dsp_code surrounder2_code_51DP[] =
{
I(0)	{0x1, 0x800Bu, 0x4000u, 0x8012u, 0x2040u},
I(1)	{0x1, 0x800Cu, 0x4001u, 0x8013u, 0x2040u},
I(2)	{0x6, 0x8005u, 0x4007u, 0x2040u, 0x2040u},
I(3)	{0x0, 0x2040u, 0x8012u, 0x8010u, 0x800Fu},
I(4)	{0x7, 0x8010u, 0x8012u, 0x8012u, 0x800Eu},
I(5)	{0x0, 0x8012u, 0x2056u, 0x4000u, 0x800Du},
I(6)	{0x0, 0x2040u, 0x8013u, 0x8011u, 0x800Fu},
I(7)	{0x7, 0x8011u, 0x8013u, 0x8013u, 0x800Eu},
I(8)	{0x0, 0x8013u, 0x2056u, 0x4001u, 0x800Du},
I(9)	{0x0, 0x8004u, 0x2040u, 0x800Bu, 0x8009u},
I(10)	{0x1, 0x8014u, 0x2056u, 0x800Cu, 0x800Au},
I(11)	{0x0, 0x8004u, 0x2040u, 0x800Cu, 0x8009u},
I(12)	{0x1, 0x8016u, 0x2056u, 0x800Bu, 0x800Au},
I(13)	{0x0, 0x8004u, 0x4006u, 0x800Bu, 0x8008u},
I(14)	{0x0, 0x8004u, 0x8004u, 0x800Cu, 0x8008u},
I(15)	{0x0, 0x8000u, 0x4002u, 0x800Bu, 0x204Fu},
I(16)	{0x0, 0x8002u, 0x4004u, 0x8018u, 0x204Fu},
I(17)	{0x0, 0x8001u, 0x4003u, 0x800Cu, 0x204Fu},
I(18)	{0x0, 0x8003u, 0x4005u, 0x801Au, 0x204Fu},
I(19)	{0x0, 0x8004u, 0x8004u, 0x2040u, 0x2040u},
// I(20)	{0x0, 0x2040u, 0x2040u, 0x2040u, 0x2040u}
// I(21)	{0x0, 0x2040u, 0x2040u, 0x2040u, 0x2040u}
// I(22)	{0x0, 0x8006u, 0x2040u, 0x2040u, 0x2040u}
// I(23)	{0x0, 0x8007u, 0x2040u, 0x2040u, 0x2040u}
};

dsp_code surrounder2_code_71DP[] =
{
I(0)	{0x1, 0x800Bu, 0x4000u, 0x8012u, 0x2040u},
I(1)	{0x1, 0x800Cu, 0x4001u, 0x8013u, 0x2040u},	
I(2)	{0x6, 0x8005u, 0x4007u, 0x2040u, 0x2040u},	
I(3)	{0x0, 0x2040u, 0x8012u, 0x8010u, 0x800Fu},
I(4)	{0x7, 0x8010u, 0x8012u, 0x8012u, 0x800Eu},	
I(5)	{0x0, 0x8012u, 0x2056u, 0x4000u, 0x800Du},	
I(6)	{0x0, 0x2040u, 0x8013u, 0x8011u, 0x800Fu},	
I(7)	{0x7, 0x8011u, 0x8013u, 0x8013u, 0x800Eu},	
I(8)	{0x0, 0x8013u, 0x2056u, 0x4001u, 0x800Du},	
I(9)	{0x0, 0x8004u, 0x2040u, 0x800Bu, 0x8009u},	
I(10)	{0x1, 0x8014u, 0x2056u, 0x800Cu, 0x800Au},
I(11)	{0x0, 0x8004u, 0x2040u, 0x800Cu, 0x8009u},
I(12)	{0x1, 0x8016u, 0x2056u, 0x800Bu, 0x800Au},
I(13)	{0x0, 0x8004u, 0x4006u, 0x800Bu, 0x8008u},
I(14)	{0x0, 0x8004u, 0x8004u, 0x800Cu, 0x8008u},
I(15)	{0x0, 0x400Au, 0x2040u, 0x400Au, 0x204Du},
I(16)	{0x0, 0x8000u, 0x4002u, 0x800Bu, 0x204Fu},
I(17)	{0x6, 0x8002u, 0x4004u, 0x8018u, 0x400Au},
I(18)	{0x0, 0x8001u, 0x4003u, 0x800Cu, 0x204Fu},
I(19)	{0x6, 0x8003u, 0x4005u, 0x801Au, 0x400Au},
I(20)	{0x0, 0x8004u, 0x8004u, 0x2040u, 0x2040u},
I(21)	{0x0, 0x2040u, 0x2040u, 0x2040u, 0x2040u},
I(22)	{0x0, 0x8006u, 0x4008u, 0x2040u, 0x2040u},
I(23)	{0x0, 0x8007u, 0x4009u, 0x2040u, 0x2040u},
};

#define surrounder2_code surrounder2_code_71DP

#undef I

// register ids:

#define R_IL		0x4000u
#define R_IR		0x4001u
#define R_IFL		0x4002u
#define R_IFR		0x4003u
#define R_ISL		0x4004u
#define R_ISR		0x4005u
#define R_IC		0x4006u
#define R_IW		0x4007u

#define R_8W		0x4008u
#define R_E		    0x4009u
#define R_S		    0x400au
#define R_TOP		0x400bu

#define R_FL		0x8000u
#define R_FR		0x8001u
#define R_SL		0x8002u
#define R_SR		0x8003u
#define R_C		    0x8004u
#define R_W		    0x8005u

#define R_SCNTR1	0x8006u
#define R_SCNTR2	0x8007u

#define R_CK		0x8008u
#define R_SK1		0x8009u
#define R_SK2		0x800Au
#define R_LB		0x800Bu
#define R_RB		0x800Cu
#define R_WFA		0x800Du
#define R_WFY		0x800Eu
#define R_WFB		0x800Fu
#define R_WFZL		0x8010u
#define R_WFZR		0x8011u
#define R_VWL		0x8012u
#define R_VWR		0x8013u
#define R_DWL		0x8014u
#define R_DWR		0x8016u
#define R_DRL		0x8018u
#define R_DRR		0x801Au
